export default {
    props: {
        title: String
    },
    data() {
        return {
            showDialog: false,
        }
    },
    methods: {
        openDialog() {
            this.showDialog = true;
        }
    },
    render(createElement) {
        let _this = this;
        return createElement('div', [
            createElement('el-button', {
                domProps: {
                    innerHTML: "render初尝试"
                },
                on: {
                    click: _this.openDialog
                }
            }),
            createElement('el-dialog', {
                props: {
                    title: _this.title,
                    visible: _this.showDialog,
                },
                on: {
                    close: () => _this.showDialog = false
                },
                scopedSlots: {
                    default: props => createElement('div', {
                        domProps: {
                            innerHTML: "这是初步尝试使用render的dialogbody"
                        },
                    }),
                },
            }, [
                createElement("span", {
                    attrs: {
                        slot: "footer"
                    },
                }, [
                    createElement("el-button", {
                        domProps: {
                            innerHTML: "取消",
                            slot: "footer"
                        },
                        on: {
                            click: () => _this.showDialog = false
                        }
                    }),
                    createElement("el-button", {
                        props: {
                            type: "primary"
                        },
                        domProps: {
                            innerHTML: "确定"
                        },
                        on: {
                            click: () => _this.showDialog = false
                        }
                    }),
                ])
            ])
        ])
    }
}